<h1><%=h "Translation Interface".t -%></h1>

<h2><%=h 'Translating'.t %> <%= link_to "#{@controller_to_translate} &raquo; #{@action_to_translate}", @url_to_translate -%></h2>
<%= javascript_include_tag 'translation_status' %>
<% if Locale.base? -%>
  <p>
    <%=h "You're currently browsing in the base language of this archive.".t %> 
		<%=h "You should go back to the page you want to translate and set your language from the pull-down menu to the language you want to translate into.".t %>
  </p>
<% else -%>
  <% if Locale.language -%>
    <h3 class="language"><%= "Currently translating into:".t + ' ' + Locale.language.native_name %></h3>
  <% end -%>
  <p>
  	<%=h "Strings are listed approximately in the order they appear in the page.".t %>
  </p>
  <dl class="translations">
    <% @translations.each do |tr| -%>
	<dt id="show_<%= tr.id.to_s %>" class="string<%-unless tr.text -%> untranslated<%-end -%>">
      <%= tr.tr_key -%>
      <span class="string translated"><%=h tr.text ? "(" + "Current translation".t + ": #{tr.text})" : "" -%></span>	  	
    </dt>
    <dd id="tr_<%= tr.id %>">        
        <%- form_remote_tag :url => { :action => :set_translation_text, :id => tr.id },
			:update => "show_#{tr.id}",
			:loading => "tr_status('show_#{tr.id}')",
			:complete => visual_effect(:highlight, "show_#{tr.id}") do %>
        <%= text_area_tag "translation_#{tr.id}", tr.text || tr.tr_key, :cols => 35, :rows => rows_for_words(tr.text || tr.tr_key) %>
        <%= submit_tag( "translate".t ) %>
        <% end -%>
    </dd>
    <% end -%>
</dl>
<% end -%>